﻿package game.breeze.message;

import java.util.HashMap;
import java.util.Map;

/**
 * Message 的摘要说明。
 */
public class Message {
	private Object source;
	private Object content;
	private Map<String, Object> transientArgs = new HashMap<String, Object>();

	public Message(Object content) {
		setContent(content);
	}

	public Message(Object content, Object source) {
		setContent(content);
		setSource(source);
	}

	public Object getSource() {
		return source;
	}

	public Object getContent() {
		return content;
	}

	public void setSource(Object obj) {
		source = obj;
	}

	protected void setContent(Object obj) {
		content = obj;
	}

	public void addTransientArg(String key, Object value) {
		transientArgs.put(key, value);
	}

	public Object getTransient(String key) {
		return transientArgs.get(key);
	}

	public void clearTransient() {
		transientArgs.clear();
		transientArgs = null;
	}
}